package com.localjoycommunity.cpdj.common.mybatis;


import cn.hutool.core.lang.UUID;
import org.springframework.stereotype.Component;

import java.util.concurrent.atomic.AtomicLong;

/**
 * @author aqie
 * @date 2020-09-11 14:23
 * @function 自定义ID 生成器
 */
@Component
public class CustomIdGenerator implements IdentifierGenerator {

    private final AtomicLong al = new AtomicLong(1);

    @Override
    public Long nextId(Object entity) {
        return null;
    }

    /**
     * String 类型id生成
     *
     * @param entity
     * @return
     */
    @Override
    public String nextUUID(Object entity) {
        return UUID.fastUUID().toString();
    }
}
